Map array of binary strings to List<MultipartFile> - #387
Merged
jemacineiras merged 2 commits intoJul 31, 2026
Merged
Conversation
processArray resolved simple array item types via MapperUtil.getSimpleType,
which has no binary detection, so `type: array, items: {type: string,
format: binary}` produced List<String>. Detect binary items with
ApiTool.isBinary (covers both OpenAPI 3.0 `format: binary` and 3.1
contentEncoding/contentMediaType) and map them to MultipartFile, matching
the existing scalar-property behaviour in processStringProperty.
Adds an array-of-binary property to the testSimpleBuild Document schema as a
regression test.
Fixes sngular#386
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
jemacineiras
approved these changes
Jul 31, 2026
jemacineiras
approved these changes
Jul 31, 2026
This was referenced Jul 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes the mapping of arrays of binary strings (multiple file upload) in the OpenAPI generator. They were generated as
List<String>instead ofList<MultipartFile>.Closes #386.
Why
ModelBuilder.processArray(...)resolved the element type of simple array items throughMapperUtil.getSimpleType(...), which has no binary detection. A single binary property was already handled correctly (MultipartFileviaprocessStringProperty), but the array path fell through toString.Change
ModelBuilder.processArray: detect binary array items withApiTool.isBinary(items)and map them toTypeConstants.MULTIPART_FILE.ApiTool.isBinaryalready covers both OpenAPI 3.0 (format: binary) and 3.1 (contentEncoding/contentMediaType). TheMultipartFileimport is added automatically sincegetTypeImportswalks the inner type of the collection.Test
attachments: array of {string, binary}property to theDocumentschema in the existingtestSimpleBuildfixture, and updated the asserted goldenDocumentDTO.javato expectList<MultipartFile>.Tests run: 118, Failures: 0, Errors: 0.Before / after
🤖 Generated with Claude Code
Version
Bumps the project version
6.6.0→6.6.1(patch, bugfix) across the engine, Maven plugin and Gradle plugin.